<div class="nav-sub w1180">
	<ul class="zoom">
		<li><a class="on" href="/crm/crmuser/index">用户管理</a></li>
		<li><a href="/crm/crmuser/group">用户组管理</a></li>
	</ul>
</div>
<div class="main-ct w1180">
<!-- 	<a href="/crm/crmuser" class="btn-cs btn-blue btn-fillet mt10">返 回</a> -->
<!-- 	<h2 class="tit-border">用户信息</h2> -->
	<form id="userForm" method="post" action="/crm/crmuser/insert-user">
	<div class="form-info mt20">
		<input name="user_id" id="user_id" type="hidden" value="<?php echo $this->user['user_id'];?>">
		<input name="user_password_old" id="user_password_old" type="hidden" value="<?php echo $this->user['user_password'];?>">
		<dl>
			<dt>账  号：</dt>
			<dd><input name="user_account" id="user_account" type="text" class="txt" value="<?php echo $this->user['user_account'];?>"></dd>
		</dl>
		<dl>
			<dt>密  码：</dt>
			<dd><input name="user_password" id="user_password" type="password" class="txt" value="<?php echo $this->user['user_password'];?>"></dd>
		</dl>
		<dl>
			<dt>确认密码：</dt>
			<dd><input name="user_password_again" id="user_password_again" type="password" class="txt" value="<?php echo $this->user['user_password'];?>"></dd>
		</dl>
		<dl>
			<dt>姓  名：</dt>
			<dd><input name="user_name" id="user_name" type="text" class="txt" value="<?php echo $this->user['user_name'];?>"></dd>
		</dl>
		<dl>
			<dt>岗  位：</dt>
			<dd><input name="user_position" id="user_position" type="text" class="txt" value="<?php echo $this->user['user_position'];?>"></dd>
		</dl>
		<dl>
			<dt>权  限：</dt>
			<dd><select name="user_group_id" id="user_group_id" class="txt">
				<option value="">请选择</option>
				<?php foreach ($this->groupList as $group):?>
				<option value="<?php echo $group['user_group_id'];?>" <?php if($this->user['user_group_id'] == $group['user_group_id']):?>selected<?php endif;?>><?php echo $group['user_group_name'];?></option>
				<?php endforeach;?>			
				</select></dd>
		</dl>
		<dl>
			<dt>店  铺：</dt>
			<dd><select name="org_id" id="org_id" class="txt">
				<option value="">请选择</option>
				<?php foreach ($this->organization as $organization):?>
				<option value="<?php echo $organization['org_id'];?>" <?php if($this->user['org_id'] == $organization['org_id']):?>selected<?php endif;?>><?php echo $organization['org_name'];?></option>
				<?php endforeach;?>
			</select></dd>
		</dl>

	</div>
	<p class="mt30 txt-center"><input class="input-cs btn-fillet btn-green" type="submit" value="确定"></p>
	</form>
</div>
<script>
$().ready(function() {
	$("#userForm").validate({
		debug:true,
		rules: {
			user_account: {
				required: true,
				minlength: 6,
				maxlength: 25,
			},
			user_password: {
				required: true,
				minlength: 6,
				maxlength: 60,
			},
			user_password_again: {
				required: true,
				equalTo: user_password,
			},
			user_name: {
				required: true,
				maxlength: 10,
			},
			user_position: {
				required: true,
				maxlength: 10,
			},
			user_group_id: {
				required: true,
			},
	
		},
		submitHandler:function(form){  
            form.submit();
	    }
	});

});
</script>